﻿using Autofac;
using System.Reflection;

/// <summary>
/// 描述：动态依赖注入配置
/// </summary>
namespace YSL.Application.Dynamics
{
    public class Ysl_GolabAutofacProfile : Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            var assemblys = Assembly.Load("YSL.Application");
            builder.RegisterAssemblyTypes(assemblys).
                Where(x => x.Name.EndsWith("Service")).AsImplementedInterfaces().InstancePerLifetimeScope();


            base.Load(builder);
        }
    }
}
